<?php if (!defined('THINK_PATH')) exit();?> <!DOCTYPE html>
<html>
  
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>
      <?php echo $title; ?> - <?php echo C('TITLE'); ?>
    </title>
     <link rel="stylesheet" href="//at.alicdn.com/t/font_mqhl04idhqx8byb9.css">
      <link rel="stylesheet" href="/project/fly/Public/layui/css/layui.css">
      <link rel="stylesheet" href="/project/fly/Public/css/global.css">
       <script src="/project/fly/Public/layui/layui.js">
        </script>
    <script src="/project/fly/Public/js/jquery-3.2.1.min.js">
        </script>
  </head>
  
  <body>
    <div class="header">
      <div class="main">
        <a class="logo" href="<?php echo U('home/index/index');?>" title="Fly">
          仿Fly社区
        </a>
        <div class="nav">
          <a href="<?php echo U('Home/index/all');?>" class="<?php if(in_array(ACTION_NAME, ['all','unsolve','solve','wonder','myquestion']))echo 'nav-this' ?>">
            <i class="iconfont icon-wenda">
            </i>
            讨论
          </a>
          <a href="javascript:;">
            <i class="iconfont icon-iconmingxinganli" style="top: 2px;">
            </i>
            案例
          </a>
          <a href="javascript:;">
            <i class="iconfont icon-ui">
            </i>
            框架
          </a>
        </div>
          <?php if($_SESSION['uid']){ ?>
           <div class="nav-user">
	         <a class="avatar" href="<?php echo U('Home/userCenter/set');?>">
	           <img src='/project/fly/<?php echo $_SESSION['face'] ?>'>
	           <cite>
	             <?php echo $_SESSION['nickname'] ?>
	           </cite>
	         </a>
           <?php if($_SESSION['msg']!=0 && $_SESSION['msg']<=99){ ?>
              <a class="nav-message" href="<?php echo U('home/userCenter/delMsg',['del'=>1]);?>" title="您有<?php echo $_SESSION['msg']; ?>条未阅读的消息"><?php echo $_SESSION['msg']; ?></a>
            <?php }elseif($_SESSION['msg']>99){ ?>
              <a class="nav-message" href="<?php echo U('home/userCenter/delMsg',['del'=>1]);?>" title="您有99+条未阅读的消息"><?php echo '99+'; ?></a>
            <?php } ?>
	         <div class="nav">
	           <a href="<?php echo U('home/userCenter/set');?>">
	             <i class="iconfont icon-shezhi">
	             </i>
	             设置
	           </a>
	           <a href="<?php echo U('home/logOut/index');?>">
	             <i class="iconfont icon-tuichu" style="top: 0; font-size: 22px;">
	             </i>
	             退了
	           </a>
	         </div>
		     </div>
          	<?php }else{ ?>
				<div class="nav-user">
		          <a class="unlogin" href="/user/login/">
		            <i class="iconfont icon-touxiang">
		            </i>
		          </a>
		          <span>
		            <a href="<?php echo U('home/login/index');?>">
		              登入
		            </a>
		            <a href="<?php echo U('home/reg/index');?>">
		              注册
		            </a>
		          </span>
		          <p class="out-login">
		            <a href="http://fly.layui.com/app/qq" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})"
		            class="iconfont icon-qq" title="QQ登入">
		            </a>
		            <a href="http://fly.layui.com/app/weibo/" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})"
		            class="iconfont icon-weibo" title="微博登入">
		            </a>
		          </p>
          </div>
          	<?php } ?>
         
      </div>
    </div>



<style type="text/css">
.page a{
  border: 1px solid #009E94;
  padding: 10px 20px;
  margin: 0 2px;
}
.current{
  background: #009E94;
  color: #fff;
  padding: 10px 20px;
  margin: 0 2px;
  border: 1px solid #009E94;
}
.page{
  margin-top: 30px;
}

</style>
<div class="main layui-clear">
  <div class="wrap">
    <div class="content" style="margin-right:0">
      <div class="fly-tab">
        <div class="layui-tab layui-tab-brief">
          <ul class="layui-tab-title">
            <li class="<?php if(ACTION_NAME=='index'){echo 'layui-this';} ?>">
              <a href="<?php echo U('Home/index/index');?>">
                首页
              </a>
            </li>
            <li class="<?php if(ACTION_NAME=='all'){echo 'layui-this';} ?>">
              <a href="<?php echo U('Home/index/all');?>">
                全部帖
              </a>
            </li>
            <li class="<?php if(ACTION_NAME=='unsolve'){echo 'layui-this';} ?>">
              <a href="<?php echo U('Home/index/unsolve');?>">
                未结帖
              </a>
            </li>
            <li class="<?php if(ACTION_NAME=='solve'){echo 'layui-this';} ?>">
              <a href="<?php echo U('Home/index/solve');?>">
                已采纳
              </a>
            </li>
            <li class="<?php if(ACTION_NAME=='wonder'){echo 'layui-this';} ?>">
              <a href="<?php echo U('Home/index/wonder');?>">
                精华帖
              </a>
            </li>
            <?php if(isset($_SESSION['uid'])): ?>
              <li class="<?php if(ACTION_NAME=='myquestion'){echo 'layui-this';} ?>">
                <a href="<?php echo U('Home/index/myquestion');?>">
                  我的帖
                </a>
              </li>
            <?php endif; ?>
          </ul>
        </div>
        <i class="layui-icon fly-search">
          &#xe615;
        </i>
      </div>
      <ul class="fly-panel fly-list">
        <?php foreach ($top as $v) :?>
           <li class="fly-list-li">
              <a href="<?php echo U('home/userCenter/center',array('id'=>$v['uid']));?>" class="fly-list-avatar">
                  <img src="<?php echo '/project/fly/'.$v['face'] ?>" alt="<?php echo $v['nickname']; ?>">
              </a>
              <h2 class="fly-tip">
                <a href="<?php echo U('home/discuss/index',array('qid'=>$v['qid']));?>">
                    <?php echo $v['title']; ?>
                </a>
                <span class="fly-tip-stick">
                  置顶
                </span>
              </h2>
              <p>
                <span>
                  <a href="<?php echo U('home/userCenter/center',array('id'=>$v['uid']));?>">
                    <?php echo $v['nickname']; ?>
                  </a>
                </span>
                <span>
                  <?php echo Ctime($v['create_time']); ?>
                </span>
                <span>
                  <?php echo $v['cname']; ?>
                </span>
                <span class="fly-list-hint">
                  <i class="iconfont" title="回答">
                    &#xe60c;
                  </i>
                  <?php echo $v['answer_num']; ?>
                  <i class="iconfont" title="人气">
                    &#xe60b;
                  </i>
                 <?php echo $v['view_num']; ?>
                </span>
              </p>
            </li>
        <?php endforeach; ?>
        <?php foreach ($main as $v) : ?>
              <li class="fly-list-li">
                <a href="<?php echo U('home/userCenter/center',array('id'=>$v['uid']));?>" class="fly-list-avatar">
                  <img src="<?php echo '/project/fly/'.$v['face'] ?>" alt="<?php echo $v['nickname']; ?>">
                </a>
                <h2 class="fly-tip">
                  <a href="<?php echo U('home/discuss/index',array('qid'=>$v['qid']));?>">
                    <?php echo $v['title']; ?>
                  </a>
                  <?php if($v['level']==1): ?>
                     <span class="fly-tip-jing">
                        精华
                      </span>
                  <?php endif; ?>
                </h2>
                <p>
                  <span>
                    <a href="<?php echo U('home/userCenter/center',array('id'=>$v['uid']));?>">
                      <?php echo $v['nickname']; ?>
                    </a>
                  </span>
                  <span>
                    <?php echo Ctime($v['create_time']); ?>
                  </span>
                  <span>
                    <?php echo $v['cname']; ?>
                  </span>
                  <span class="fly-list-hint">
                    <i class="iconfont" title="回答">
                      &#xe60c;
                    </i>
                    <?php echo $v['answer_num']; ?>
                    <i class="iconfont" title="人气">
                      &#xe60b;
                    </i>
                    <?php echo $v['view_num']; ?>
                  </span>
                </p>
              </li>
            <?php endforeach; ?>
      </ul>
      <div style="text-align: center" class="page">
         <?php echo $pages; ?>
      </div>
    </div>
  </div>
</div>
   

</div>
    <div class="footer">
      <p>
        <a href="http://fly.layui.com/">
          Fly社区
        </a>
        2017 &copy;
        <a href="http://www.layui.com/">
          layui.com
        </a>
      </p>
      <p>
        <a href="http://fly.layui.com/jie/3147.html" target="_blank">
          产品授权
        </a>
        <a href="http://fly.layui.com/jie/8157.html" target="_blank">
          获取Fly社区模版
        </a>
        <a href="http://fly.layui.com/jie/2461.html" target="_blank">
          微信公众号
        </a>
      </p>
    </div>

    
  </body>
	<script type="text/javascript">
		layui.use(['layer', 'form','element'], function(){
		  var layer = layui.layer
		  ,form = layui.form();
		   $ = layui.jquery;
		  /*form.on('submit(login)', function(data){
				$.ajax({
				url:'<?php echo U("home/login/checkdata");?>',
					type: 'POST',
					dataType: 'json',
					data: data.field,
				})
				.done(function(respones) {
					if(respones.error==1){
                        layer.msg(respones.info,function (){

                     })
					}else{
                        layer.alert('登录成功',{icon:6},function (){
                            location.href='<?php echo U("home/user/index");?>';
                        });
                    }
				})
				.fail(function() {
					console.log("error");
				});

				return false;
		   });*/
		 
		
		});
	</script>
</html>